package org.taohuawu.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import org.taohuawu.feign.fallback.ItemFeignServiceFallback;
import org.taohuawu.pojo.Item;
import org.taohuawu.web.util.JsonResult;

import java.util.List;

@FeignClient(name = "item-service", fallback = ItemFeignServiceFallback.class)
@RequestMapping("/item")
public interface ItemFeignService {
    @GetMapping("/{orderId}")
    public JsonResult<List<Item>> getItems(@PathVariable String orderId);

    @PostMapping("/decreaseNumber")
    public JsonResult decreaseNumber(@RequestBody List<Item> list);
}
